mount it locally, so we can modify the local file db: image:mysql ports: -"8003:3306" Environment: -mysql_root_password=123456 volumes: -/home/jinhan/mysql/ Data:/var/lib/mysql //database data, hanging locally -/home/jinhan/mysql/conf:/etc/mysql/conf.d//Database configuration, we're going to put it ourselves.Four. Mounting volumesWe're experimenting with MySQL and WordPress.Configure MySQL config
responsible for monitoring 8080 ports, Nginx received dynamic Web pages need to be handled by Tomcat, to be forwarded to 8080 ports. In the Docker environment, the Nginx directly forwards the request to 8080,tomcat is not forwarded. So with Llinks, the value here is T1, which is the name.In the nginx.conf file, add the following configuration:On the HTTP side, addUpstream Backend {#后台负载均衡容器及端口, this example
( referred to as a project , that is, an item ), For example, a scheduler, two Web the service container plus the backend database service container, and so on. 650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; padding-right:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/87/03/wKiom1fRGqrhQc8gAACa9_ Ftpie004.
/compose/releases/download/1.17.1/docker-compose-' uname -S '-' uname-m '-o/usr/local/bin/docker-composesudo chmod +x/usr/local/bin/docker-compose(the latest version can be from here https://github.com/
of seconds after the container Waits for the sigterm signal to exit (10 s by default) stop_signal # specify Stop the signal sent by the container (the default value is sigterm, which is equivalent to kill PID; sigkill is equivalent to kill-9 PID; this option is ignored when swarm is deployed) sysctls # Set the kernel parameters in the container (this option will be ignored when swarm is used for deployment) ulimits # Set the container's limit userns_mode # If the
encounter the need for multiple containers to cooperate with each other to complete a task. For example, to implement a Web project, in addition to the Web Services container itself, it is often necessary to add the backend database service container, and so on.
Compose just met the demand. It allows the user to define a set of associated application containers through a separate
app:restart:always Build:./app working_dir:/app volumes:-. /app:/app-~/.m2:/root/.m2 Expose:-"8080" depends_on:-nginx-mysql command:mvn clean s Pring-boot:run-dspring-boot.run.profiles=docker
version: ‘3‘: Represents the use of a third-generation syntax to build a Docker-compose.yaml file.
services: Used to indicate the service that
Docker ~ Docker-compose and dockercompose
Back to directory
Docker-compose is a tool used to define and run complex applications in Docker. For example, to define multiple containers in
build a Docker-compose.yaml file.
services: Used to indicate the service that compose needs to start, we can see that there are three services in this file: Nginx, MySQL, app.
container_name: Container Name
environment: The information under this node is passed into the container as an environment variable, and in this example the MySQL service configures
Docker-compose Use Example
Using Docker to build a MySQL + Java service + Nginx, a total of 4 Docker containers, if used Docker run way a container to create very cumbersome. In order to create containers more efficiently,
to useRetry upon failureMechanismrestart: on-failureWhen the configserver fails, you can restart until it is successful (the master is until Eureka is started ).Container and container must communicate with each other by service name
If we want to deploy a specific project in docker-compose and want to access other services, we need to use the service name defined in d
Using the Docker process, we need to look at the data generated in the container, and between the container and the container, the container and the host before the data sharing, backup and other operations, where the data management of the container. The management of data currently provides the following two ways:#数据卷 Data Volumes#数据卷容器 Data Volumes containers
Brief introduction:Docker can run a configured server on a single command, which is handy.But there is also a problem is that when the parameters are more, the mapping directory is more, map port more ...I used to write a script, start with a foot, very low ah.Also see some of the Docker Image introduction page has introduced Docker-compose, but because has been
Tags: always folder ges latest command put PWD general execInformation:
Docker version ( $ docker --version ): Docker version 18.03.1-ce, version 9ee9f40
System Information: WINDOWS10 Professional Edition
MySQL is mounted in Docker's volume 1. The first step: 1 Docker volume create Mysql-data 2. S
. The use is relatively simple. First download the image to Local: docker pull jwilder/nginx-proxy . And then run docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy . Of course, if you need to use docker-compose, we don't need to start it so manually. Here is just a simple introducti
, if we do not specify the port ing relationship between the container and the host, Docker will map the port at will.
Mount a host directory as a data volume
You can also use the-v tag to mount a local existing Directory to the container as a data volume.
docker run -dp --name web -v /src/webapp:/opt/webapp ubuntu:1404
The above command loads the host/src/webapp directory to the/opt/webapp directory of
This article mainly introduces the use of Docker compose Orchestration Laravel application, has a certain reference value, now share to everyone, the need for friends can refer to
Objective
Laravel Official development environment recommended is homestead (in fact, is a well-packaged vagrant box), I feel this is more heavy, so I used Docker
can place some programs in the local directory and then install them. Note that the path to the local directory must be an absolute path .For example, I copy a file vscode-amd64.deb to a directory that is hanging, and I can see it directly in the Docker container.It is important to note that the default permissions for Docker mounted data
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.